package com.zhaowudi.wj.service;



import com.zhaowudi.wj.dao.CategoryDAO;
import com.zhaowudi.wj.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryService {
    @Autowired
    CategoryDAO categoryDAO;

    public List<Category> list() {
        String sort = " order by id desc";
        return categoryDAO.findAll(sort);
    }

    public Category get(int id) {
        Category c= categoryDAO.findById(id);
        return c;
    }
}

